package com.ys.controller.api.hr;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ys.config.MenuId;
import com.ys.entity.hr.ThrVatApplyDetail;
import com.ys.entity.sys.YsCol;
import com.ys.enume.sys.YsColEnum;
import com.ys.service.hr.ThrVatApplyDetailService;
import com.ys.service.sys.CommonApiService;
import com.ys.service.sys.UploadService.UploadDto;
import com.ys.util.ExportExcelUtils;
import com.ys.vo.LayuiTableVoJA;
import com.ys.vo.R;

@Controller
@RequestMapping("/api/inter/thrVatApplyDetail")
public class ApiInterThrVatApplyDetailController {
	
//	private static final Logger logger = Logger.getLogger(ApiAdminLoginController.class);
	
	@Autowired
	private CommonApiService<ThrVatApplyDetail> commonApiService;
	@Autowired
	private ThrVatApplyDetailService thrVatApplyDetailService;
	
	@RequiresPermissions("thrVatApplyDetail:view")
	@RequestMapping("/search")
    @ResponseBody
	public LayuiTableVoJA search(@ModelAttribute ThrVatApplyDetail cond){
		
		return commonApiService.searchLay(cond);
	}

	/**
	 * 编辑
	 */
	@RequiresPermissions("thrVatApply:add")
	@PostMapping("/edit")
    @ResponseBody
	public R edit(Long id, String subData){
		try {
			return thrVatApplyDetailService.edit(id, subData, MenuId.THR_VatApplyDetail);
		} catch (Exception e) {
			e.printStackTrace();
			return R.error("系统正在开小差，请联系客服，我们将第一时间为您解决！");
		}
	}
}
